<?php
namespace app\index\Model;
use think\Model;

class TpArticle extends Model
{														
	public function getFooterArts()
    {
    	//获取帮助分类
        $helpCateRes=db('tp_cate')->where(array('cate_type'=>3))->order('sort DESC')->select();
        foreach ($helpCateRes as $k => $v) {
        	$helpCateRes[$k]['arts']=db('tp_article')->where(array('cate_id'=>$v['id']))->select();
          
        }
        return $helpCateRes;

    }
//根据文章id获取文章信息
    public function getArts($id){
    	return db('tp_article')->where(array('id'=>$id))->find();
    }


    public function getShopInfo(){
        $artArr=db('tp_article')->where(array('cate_id'=>3))->select();
        return $artArr;
    }

    //根据文章分类id获取文章
    public function getCateArts($cateID,$limit){
        $artArr=db('tp_article')->where(array('cate_id'=>$cateID))->limit($limit)->select();
        return $artArr;
    }


    
   
}
